<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>header</title>

        <link rel="stylesheet" href="public/css/header.css">
    </head>
    <body>
        <nav class="navbar navbar-default">
            <div class="container">

                <div class="navbar-header">
                    <a href="index.php" class="navbar-brand">
                        <img src="public/imgs/logos/logo.png" class="navbar-logo" />
                    </a>
                </div>

                <ul class="nav nav-pills">
                    {foreach $navData as $k=>$v}
                        {if $k==0}
                            <li class="{$array[$k]}">
                                <a href="index.php?nid={$v['id']}">{$v['name']}</a>
                            </li>
                        {else}
                            <li class="{$array[$k]}">
                                <a href="index.php?p=page&nid={$v['id']}">{$v['name']}</a>
                            </li>
                        {/if}
                    {/foreach}
                </ul>

                <ul class="nav nav-tabs">
                    {if empty($smarty.session.admin.0.user) && empty($smarty.session.user.0.user)}
                        <li>
                            <a href="?m=main">成为百家号作者</a>
                        </li>
                    {else}
                        {if $smarty.session.user.0.level_id == 1}
                            <li>
                                <a href="?c=index&m=beAuthor">成为百家号作者</a>
                            </li>
                        {else if $smarty.session.user.0.level_id == 2 && empty($smarty.session.admin.0.user)}
                        <li>
                            <a href="?c=index&m=addArticle">写文章</a>
                        </li>
                        {else if}
                        <li>
                            <a href="?c=admin">后台首页</a>
                        </li>
                        {/if}
                    {/if}

                    {if empty($smarty.session.admin.0.user) && empty($smarty.session.user.0.user)}
                    <li>
                        <a href="javascript:;" id="btn">登录</a>
                    </li>
                    {else}
                    <li>
                        {if empty($smarty.session.admin.0.user)}
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">{$smarty.session.user.0.user}<span class="caret"></span></a>
                        {else}
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">{$smarty.session.admin.0.user}<span class="caret"></span></a>
                        {/if}
                        <ul class="dropdown-menu" role="menu">
                            <li>
                                <a href="?c=userCenter&action=show">个人中心</a>
                            </li>
                            <li>
                                {if empty($smarty.session.admin.0.user)}
                                <a href="?c=user&action=userlogout">退出</a>
                                {else}
                                <a href="??c=user&action=logout">退出</a>
                                {/if}
                            </li>
                        </ul>
                    </li>
                    {/if}
                    <li>
                        <a href="?c=index">百度首页</a>
                    </li>
                </ul>

            </div>
        </nav>
    </body>
</html>